home *** CD-ROM | disk | FTP | other *** search
- In message <E0yreuW-0006Zi-00@spring.nexus.co.uk>
- Philip Blundell wrote:
-
- >
- > No; ELF symbols have _no_ leading underscore. The `__' symbols are probably
- > functions in libgcc. If you post the actual messages I might be able to guess
- > what's wrong.
-
- Then I probably did something wrong. I'm going to start (almost) from
- scratch.
-
- Here's a more detailed description of errors I came across when
- compiling gcc 2.8.1 for ELF. Previous steps like compiling gcc and
- binutils for a.out and compiling binutils for ELF were ok.
- Configure was run as follows:
-
- # ./configure --target=arm-unknown-linuxelf --host=arm-unknown-linuxaout --prefix=/usr/local
-
- So the system should produce ELF but run on an a.out machine.
-
- [voss@yoda gcc-2.8.1]$ make LANGUAGES=c
- ...
- rm -f tmplibgcc1.a libgcc1.S
- cp ./config/arm/lib1funcs.asm libgcc1.S
- for name in _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx; \
- do \
- echo ${name}; \
- ./xgcc -B./ -O2 -fomit-frame-pointer -DCROSS_COMPILE -DIN_GCC -g
- -I./include -g0 -I. -I. -I./config -c -DL${name} libgcc1.S; \
- if [ $? -eq 0 ] ; then true; else exit 1; fi; \
- mv libgcc1.o ${name}.o; \
- /usr/local/arm-unknown-linuxelf/bin/ar rc tmplibgcc1.a ${name}.o; \
- rm -f ${name}.o; \
- done
- _udivsi3
- _divsi3
- _umodsi3
- _modsi3
- _dvmd_lnx
- libgcc1.S:430: asm/unistd.h: No such file or directory
-
- Hmm, asm/unistd.h cannot be found but I'm sure I have such a file
-
- [voss@yoda include]$ ls -l /usr/include/asm/unistd.h
- -rw-r--r-- 1 root root 11931 Jun 20 13:49 /usr/include/asm/unistd.h
-
- Let's see what directories unistd.h is looked for:
-
- [voss@yoda gcc-2.8.1]$ ./xgcc -v -B./ -O2 -fomit-frame-pointer
- -DCROSS_COMPILE -DIN_GCC -g -I./include -g0 -I. -I. -I./config -c
- -DL_dvmd_lnx libgcc1.S
- Reading specs from ./specs
- gcc version 2.8.1
- ./cpp -lang-asm -v -I./include -I. -I. -I./config -isystem ./include
- -undef -$ -Dunix -Darm -Dlinux -D__ELF__ -D__unix__ -D__arm__ -D__linux__
- -D__ELF__ -D__unix -D__arm -D__linux -Asystem(unix) -Asystem(posix)
- -Acpu(arm) -Amachine(arm) -D__ASSEMBLER__ -D__CHAR_UNSIGNED__
- -D__OPTIMIZE__ -g -g0 -D__ARM_ARCH_3__ -D__APCS_26__ -DCROSS_COMPILE
- -DIN_GCC -DL_dvmd_lnx libgcc1.S /tmp/cca10581.s
- GNU CPP version 2.8.1 (ARM GNU/Linux with ELF)
- #include "..." search starts here:
- #include <...> search starts here:
- include
- .
- config
- include
- End of search list.
- libgcc1.S:430: asm/unistd.h: No such file or directory
-
- So asm/unistd.h is not found because /usr/include isn't searched.
- That probably ok because we don't want to handle system includes at
- this stage of the compilation. I'll just make a link so that
- asm/unistd.h is found.
-
- [voss@yoda asm]$ pwd
- /export/gcc-2.8.1/include/asm
- [voss@yoda asm]$ ls -l
- total 0
- lrwxrwxrwx 1 voss voss 25 Jul 9 13:16 unistd.h -> /usr/include/asm/unistd.h
-
- [voss@yoda gcc-2.8.1]$ make LANGUAGES=c
- ...
- gcc -v -c -DCROSS_COMPILE -DIN_GCC -g -DHAVE_CONFIG_H -I. -I. -I./config ./cp/g++spec.c
- Reading specs from ./specs
- gcc version 2.8.1
- /usr/lib/gcc-lib/arm-unknown-linuxaout/2.8.1/cpp -lang-c -v -I. -I.
- -I./config -undef -D__GNUC__=2 -D__GNUC_MINOR__=8 -Dunix -Darm -Dlinux
- -D__ELF__ -D__unix__ -D__arm__ -D__linux__ -D__ELF__ -D__unix -D__arm
- -D__linux -Asystem(unix) -Asystem(posix) -Acpu(arm) -Amachine(arm)
- -D__CHAR_UNSIGNED__ -g -D__ARM_ARCH_3__ -D__APCS_26__ -DCROSS_COMPILE
- -DIN_GCC -DHAVE_CONFIG_H ./cp/g++spec.c /tmp/cca11608.i
- GNU CPP version 2.8.1 (ARM GNU/Linux with a.out)
- #include "..." search starts here:
- #include <...> search starts here:
- .
- config
- /usr/local/include
- /usr/arm-unknown-linuxaout/include
- /usr/lib/gcc-lib/arm-unknown-linuxaout/2.8.1/include
- /usr/include
- End of search list.
- /usr/lib/gcc-lib/arm-unknown-linuxaout/2.8.1/cc1 /tmp/cca11608.i -quiet
- -dumpbase g++spec.c -g -version -o /tmp/cca11608.s
- GNU C version 2.8.1 (arm-unknown-linuxaout) compiled by GNU C version 2.8.1.
- as -o g++spec.o /tmp/cca11608.s
- gcc -v -DCROSS_COMPILE -DIN_GCC -g -DHAVE_CONFIG_H -o g++ g++.o g++spec.o prefix.o \
- version.o choose-temp.o pexecute.o obstack.o ` case "gcc -v" in "cc") echo "" ;; esac `
- Reading specs from ./specs
- gcc version 2.8.1
- ld -dynamic-linker /lib/elf/ld-linux.so.2 -o g++ crt1.o crti.o
- ./crtbegin.o -L/usr/local/qt/lib -L.
- -L/usr/lib/gcc-lib/arm-unknown-linuxaout/2.8.1
- -L/usr/arm-unknown-linuxaout/lib g++.o g++spec.o prefix.o version.o
- choose-temp.o pexecute.o obstack.o -lgcc -lc -lgcc ./crtend.o crtn.o
- ld: cannot open crt1.o: No such file or directory
- make: *** [g++] Error 1
-
- Why is g++ built now? I thought I only told make to build the C
- compiler, not the C++ compiler. And why does ld try to produce an ELF
- binary? Should that be still an a.out binary?
-
- Maybe I have progressed too far. Isn't xgcc the result I wanted? A
- C compiler running as a.out producing ELF.
-
- >
- > p.
- >
-
- Regards,
- Stefan
-
- --
- Stefan Voss
- (voss@yoda.in-berlin.de)
-
- unsubscribe: body of `unsubscribe linux-arm' to majordomo@vger.rutgers.edu
-
-